package com.exam.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exam.entity.MaterialQuestion;
import com.exam.mapper.MaterialQuestionMapper;
import com.exam.service.MaterialQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MaterialServiceImpl implements MaterialQuestionService {
    @Autowired
    private MaterialQuestionMapper materialQuestionMapper;

    @Override
    public List<MaterialQuestion> findByIdAndType(Integer paperId) {
        return materialQuestionMapper.findByIdAndType(paperId);
    }

    @Override
    public IPage<MaterialQuestion> findAll(Page<MaterialQuestion> page) {
        return materialQuestionMapper.findAll(page);
    }

    @Override
    public MaterialQuestion findOnlyQuestionId() {
        return materialQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public int add(MaterialQuestion materialQuestion) {
        return materialQuestionMapper.add(materialQuestion);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer pageNo) {
        return materialQuestionMapper.findBySubject(subject,pageNo);
    }
}
